package com.bigdata.visualanalysis.bean;

public class AdsDayBuyCount {

    private String dt;
    private int buycount;

    public AdsDayBuyCount() {
    }

    public AdsDayBuyCount(String dt, int buycount) {
        this.dt = dt;
        this.buycount = buycount;
    }

    public String getDt() {
        return dt;
    }

    public void setDt(String dt) {
        this.dt = dt;
    }

    public int getBuycount() {
        return buycount;
    }

    public void setBuycount(int buycount) {
        this.buycount = buycount;
    }

}
    create external table ads_day_buycount(dt string,buycount bigint) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' LOCATION '/warehouse/userbehaviorlogdb/ads/ads_day_buycount';

        insert overwrite table ads_day_buycount select dt,buycount from dws_day_buypvuvcount;


        create external table ads_userbehavior_count(userbehavior string,count bigint) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' LOCATION '/warehouse/userbehaviorlogdb/ads/ads_userbehavior_count';

        insert overwrite table ads_userbehavior_count select 'pv' userbehavior,sum(pvcount) count from dws_day_buypvuvcount union select 'cart' userbehavior,sum(cartcount) count from dws_day_buypvuvcount union select 'fav' userbehavior,sum(favcount) count from dws_day_buypvuvcount union select 'buy' userbehavior,sum(buycount) count from dws_day_buypvuvcount;

        10）热销商品类目TOP10
        create external table ads_goodstypeid_buycount(goodsTypeId string,buycount bigint) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' LOCATION '/warehouse/userbehaviorlogdb/ads/ads_goodstypeid_buycount';

        insert overwrite table ads_goodstypeid_buycount select goodsTypeId,buycount from dws_goodstype_behaviorscount order by buycount desc limit 10;
